﻿package com.potocrewz.utils 
{
	import flash.display.MovieClip;
	import gs.easing.Sine;
	import gs.TweenMax;
	
	/**
	 * ...
	 * @author Adrien Lamotte
	 */
	public class ClipManagement 
	{
		
		public static function clear_clip(mc:MovieClip):void {
			while(mc.numChildren > 0) {
				mc.removeChildAt(0);
			}
		}
		
		
		public static function clear_clip_smooth(mc:MovieClip,duration:Number):void {
			TweenMax.to(mc, duration, { autoAlpha:0, ease:Sine.easeOut, onComplete:function() {
				while(mc.numChildren > 0) {
					mc.removeChildAt(0);
				}
			}} );
		}		
		
	}
	
}